package mumethod;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class PropertiesFunction {

	public void WriteProperties(String name, String property){
		try {
			FileWriter fw = new FileWriter("conf/muproject.properties");
			Properties prop = new Properties();
			prop.setProperty(name, property);
			prop.store(fw, "User");
			fw.flush();
			fw.close();
		} catch (IOException e) {
			e.getMessage();
		}
	}
	
	public String ReadProperties(String name){
		String value = "";
		try {
			FileReader fr = new FileReader("conf/muproject.properties");
			Properties prop = new Properties();
			prop.load(fr);
			value = prop.getProperty(name);
			fr.close();
			return value;
		} catch (IOException e) {
			e.getMessage();
			return value;
		}
	}
}
